-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HADOOP-19402. [JDK11] JDiff Support JDK11. #8038
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
|
@steveloughran @pan3793 This PR has been in preparation for quite some time by Hualong, and it consists of two main parts:
I’d appreciate your help reviewing this PR. |
|
💔 -1 overall
This message was automatically generated. |
| </build> | ||
| </profile> | ||
| <profile> | ||
| <id>jdk17</id> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <id>jdk17</id> | |
| <id>jdk17+</id> |
|
given trunk is now java17+ only, do we need to have a java17 source tree and profile? We can just delete all java8 code and put this in its place. I would support this as it keeps the codebase cleaner |
Description of PR
JIRA:HADOOP-19402. [JDK11] JDiff Support JDK11.
This PR restores the ability to generate JDiff API XML on JDK 17 by porting Hadoop’s in‑tree doclets to the modern JDK 9+ Doclet API (
jdk.javadoc.doclet), while preserving the legacy command‑line surface and XML output contract used in our release process.Background. The original JDiff tool and its legacy doclet APIs predate JPMS and JDK 9; the upstream artifact (
jdiff:1.0.9) is from 2005 and does not support JDK 9+ doclet APIs. Hadoop’s release process, however, still depends on JDiff XML to publish API diffs between releases.Why now. Since JEP 221 (JDK 9), the standard
com.sun.javadocdoclet path was superseded byjdk.javadoc.doclet.*, and the old doclet was eventually removed/replaced in modern JDKs. To run on JDK 17, we need doclets implemented against the new API.How was this patch tested?
Built with JDK 17 and the docs profile to ensure JDiff XML is emitted.
This produces JDiff XML for each module. For example, HDFS:
Apache_Hadoop_HDFS_3.5.0-SNAPSHOT.xml
For code changes:
All changes are scoped to the hadoop-annotations module and only affect build-time doclet code.
src/main/java17underhadoop-common-project/hadoop-annotations.jdk17(activated on JDK ≥ 17) that:java17sources viabuild-helper-maven-plugin.maven-compiler-pluginat-release 17and-add-modules jdk.javadoc.java17)ExcludePrivateAnnotationsJDiffDocletIncludePublicAnnotationsJDiffDocletExcludePrivateAnnotationsStandardDocletIncludePublicAnnotationsStandardDocletDoclet#run(DocletEnvironment).jdk.javadoc.doclet.StandardDocletto keep the same inclusion/exclusion semantics when producing regular Javadoc.RootDocProcessorandStabilityOptionsvariants that operate onDocletEnvironment, preserving:@InterfaceAudience.Private/LimitedPrivate)IncludePublic*doclets)unstable,evolving, etc.Related JDiff changes (temporary local test build; JDK 17 adaptation implemented)
I implemented the JDK 17 adaptation in JDiff (port to the
jdk.javadoc.docletAPI) and validated Hadoop’s docs build using a temporary, locally installed artifact:jdiff:1.1.1-jdk17. This build is not published to Maven Central and is provided only so reviewers can reproduce JDiff XML generation on JDK 17. The implementation is available in zhtttylz/jdiff#4.